home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_tem_mazeimp1.cog < prev    next >
Text File  |  1999-11-15  |  8KB  |  268 lines

  1. # Jones 3D Cog Script
  2. #
  3. # TEM_MazeImp1.cog
  4. #
  5. # [TRM]
  6. #
  7. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  8. # ========================================================================================
  9.  
  10. symbols
  11.  
  12.     message     startup
  13.     message     activated
  14.     message     entered
  15.     message     damaged
  16.     
  17.     thing       player          local
  18.     thing       rocks           local
  19.     thing       dustThing       local
  20.     thing       debris          # debris origin
  21.     thing       dustPos         # dust cloud origin
  22.     thing       offsetCam
  23.     thing       indyCam
  24.     thing       dustTarg        # move dust to this pos
  25.     thing       debrisPos
  26.     
  27.     surface     shakeMe         mask=0x408
  28.     surface     sayIt
  29.     
  30.     template    debris0=stoneshrapbm_nc         local
  31.     template    tpl_Debris=+dummy_debris        local
  32.     template    dust=dustcloud                  local
  33.     
  34.     #template    debris1=stoneshrapas_nc         local
  35.     #template    debris2=stoneshrapbm_nc         local
  36.     #template    debris3=stoneshrapas_nc         local
  37.     #template    debris4=stoneshrapbm_nc         local
  38.     #template    debris5=stoneshrapas_nc         local
  39.     #template    debris6=stoneshrapbm_nc         local
  40.     #template    debris7=stoneshrapas_nc         local
  41.     
  42.     # ** voice lines **
  43.     sound       inCrumble=Inxj025.wav                   local   # ...ready to crumble.
  44.     sound       inVibrate=Inxj026.wav                   local   # A little vibration...
  45.     
  46.     # ** sound fx **
  47.     sound       sfxCharge=imp1_chargeup.wav             local
  48.     sound        sfx_Explode=shw_wall_crash.wav          local   # like, bang.
  49.     
  50.     # ** music **
  51.     sound       mus_Eerie=mus_gen_eerie1.wav            local
  52.     
  53.     material    dustMat=gen_a4sfx_dustcloud.mat            local
  54.     
  55.     cog         cameraShake
  56.     cog         cog_Hint
  57.     
  58.     vector      playervec       local
  59.     vector      playery         local
  60.     vector      playerx         local
  61.     vector      vecPos          local
  62.     vector      rocksVel        local
  63.     vector      dustStart       local
  64.     vector      dustEnd         local
  65.     
  66.     # ** subroutines **
  67.     flex        vibeLine        local
  68.     
  69.     int         i=0             local
  70.     int         saidIt=0        local
  71.     int         playing=0       local
  72.     int         numDebris=40    local
  73.     int         done=0          local
  74.         
  75. end
  76.  
  77. # ========================================================================================
  78.  
  79. code
  80.  
  81. startup:
  82.  
  83.     ClearAdjoinFlags(shakeMe, 2);         # no move
  84.     return;
  85.     
  86. # ========================================================================================
  87.  
  88. activated:
  89.  
  90.     player = GetLocalPlayerThing();
  91.  
  92.     if((GetSenderRef() == shakeMe) && (done == 0) && (playing == 0))
  93.     {
  94.         # player activated with an IMP part so bail out
  95.         if((GetCurWeapon(player) >= 14) && (GetCurWeapon(player) <= 18)) return;
  96.         
  97.         # player activated with lighter
  98.         else if(GetCurWeapon(player) == 13)
  99.         {
  100.             playing = 1;
  101.             
  102.             # put away the lighter
  103.             DeselectWeapon(player);
  104.             DeselectWeaponWait(player);
  105.             
  106.             Call vibeLine;
  107.         }
  108.         
  109.         # normal activation
  110.         else
  111.         {
  112.             playing = 1;
  113.             
  114.             # wait for weapon to be put away
  115.             DeselectWeaponWait(player);
  116.             
  117.             Call vibeLine;
  118.         }
  119.     }   
  120.  
  121.     return;
  122.     
  123. # ========================================================================================
  124.  
  125. entered:
  126.  
  127.     player = GetLocalPlayerThing();
  128.     playervec = GetThingLVec(player);
  129.     playery = VectorY(playervec);
  130.     playerx = VectorX(playervec);
  131.  
  132.     if((GetSenderRef() == sayIt) && (saidIt == 0))
  133.     {
  134.         if ((playery > 0) && ((playerx > -0.7) && (playerx < 0.7)))     # north
  135.         {
  136.             saidIt = 1;
  137.             PlayVoice(player, inCrumble, 1.0, 1);
  138.         }
  139.     }
  140.     
  141.     return;   
  142.         
  143. # ========================================================================================
  144.  
  145. damaged:
  146.  
  147.     player = GetLocalPlayerThing();
  148.     
  149.     if((GetParam(1) == 0x1000) && (done == 0))
  150.     {
  151.         done = 1;
  152.         
  153.         # solve hint5
  154.         SendMessage(cog_Hint, user0);
  155.         
  156.         # do cutscene stuff
  157.         MakeMeStop();
  158.         StartCutscene(2);
  159.         
  160.         # Switch to indyCam
  161.         SetCameraFocus(2, indyCam);
  162.         SetCameraSecondaryFocus(2, player);
  163.         SetCurrentCamera(2);
  164.         
  165.         # start cameraShake
  166.         SendMessage(cameraShake, user2);
  167.         
  168.         # alter fov for zoom-in effect
  169.         SetCameraFOV(70, 1, 2.5);
  170.         
  171.         # play temp sfx
  172.         PlaySoundLocal(sfxCharge, 1.0, 0.0, 0x0, 0);
  173.         
  174.         # light up the player
  175.         SetThingLight(dustPos, '0.25 0.55 1.0', 5.0, 2.0);
  176.         Sleep(2.5);
  177.         
  178.         # reset fov
  179.         SetCameraFOV(90, 0, 0.0);
  180.         
  181.         # kill dynamic light
  182.         SetThingLight(dustPos, '0.0 0.0 0.0', 5.0, 2.0);
  183.         
  184.         # create dust cloud
  185.         dustStart = VectorSet(0.2, 0.2, 0.5);
  186.         dustEnd    = VectorSet(1.2, 1.2, 0.0);
  187.         dustThing = CreateThing(dust, dustPos);
  188.         CaptureThing(dustThing);
  189.         
  190.         # animate dust cloud
  191.         SetMaterialCel(dustMat, 0);
  192.         MaterialAnim(dustMat, 8.0, 1);
  193.         AnimateSpriteSize(dustThing, dustStart, dustEnd, 5.0);
  194.         
  195.         MoveThingToPos(dustThing, GetThingPos(dustTarg), 4.0);
  196.         
  197.         # play explosion sfx
  198.         PlaySoundLocal(sfx_Explode, 1.0, 0.0, 0x0, 0);
  199.         
  200.         # alter adjoin
  201.         SetFaceGeoMode(shakeMe, 0);     # no draw
  202.         SetAdjoinFlags(shakeMe, 2);     # move
  203.         
  204.         # create debris
  205.         CreateThing(tpl_Debris, debrisPos);
  206.         
  207.         # drop debris
  208.         #for(i=0; i<numDebris; i=i+1)                                                                        
  209.         #{                                                                                                    
  210.         #    vecPos = VectorSet(rand()*0.3, rand()*0.2, 0.0);
  211.         #    #rocks = CreateThingAtPos(debris0[RandBetween(0, 7)], GetThingSector(debris), VectorAdd(GetThingPos(debris), VectorAdd('-0.05 -0.05 0.0', vecPos)), '0 0 0');
  212.         #    rocks = CreateThingAtPos(debris0, GetThingSector(debris), VectorAdd(GetThingPos(debris), VectorAdd('-0.05 -0.05 0.0', vecPos)), '0 0 0');
  213.         #    rocksVel = VectorSet(0, 0, 0.01);
  214.         #    SetThingVel(rocks, VectorScale(rocksVel, 0.7));
  215.         #}
  216.         
  217.         # rest for a bit
  218.         Sleep(0.5);
  219.         
  220.         # stop cameraShake
  221.         SendMessage(cameraShake, user3);
  222.         
  223.         # restore camera
  224.         SetCameraPosition(1, GetThingPos(indyCam));
  225.         SetCurrentCamera(1);
  226.         
  227.         # restore controls
  228.         ClearActorFlags(player, 0x200000);
  229.         EndCutscene();
  230.         
  231.         # play music cue (temp?)
  232.         PlaySoundLocal(mus_Eerie, 1.0, 0.0, 0x0, 0);
  233.     }
  234.  
  235.     return;
  236.  
  237. # ========================================================================================
  238.  
  239. vibeLine:
  240.  
  241.     # do cutscene stuff
  242.     MakeMeStop();
  243.     StartCutscene(0);
  244.     
  245.     # interp camera
  246.     SetExtCamOffsetToThing(offsetCam);
  247.     Sleep(0.3);
  248.     
  249.     # activate face and say line
  250.     #PlayMode(player, 60, 0);
  251.     #Sleep(0.3);
  252.     PlayVoice(player, inVibrate, 1.0, 1);
  253.     
  254.     # restore controls and camera
  255.     ClearActorFlags(player, 0x200000);
  256.     RestoreExtCam();
  257.     
  258.     EndCutscene();
  259.     
  260.     playing = 0;
  261.     
  262.     return;
  263.     
  264. # ========================================================================================
  265.  
  266. end
  267.  
  268.